#include <iostream>
#include "src/queue/circular_queue.cpp"

void TestQueue1() {

    CircularQueue queue;
    int value;

    InitQueue(&queue);

    printf("Test enqueue:\n");
    for(int i = 1; i <= 5; i ++){
        if(Enqueue(&queue, i * 10)){
            printf("enqueue element: %d\n",i * 10);
        }
    }

    printf("\nqueue content: \n");
    TraverseQueue(&queue);

    printf("Test gethead element:\n");
    if(GetHead(&queue,&value)){
        printf("front queue element: %d\n",value);
    }

    printf("Test dequeue:\n");
    for(int i = 1; i <= 3; i ++){
        if(DeQueue(&queue, &value)){
            printf("dequeue element: %d\n",value);
        }
    }

    printf("\nqueue content: \n");
    TraverseQueue(&queue);

    printf("Test enqueue again:\n");
    for(int i = 6; i <= 7; i ++){
        if(Enqueue(&queue, i * 10)){
            printf("enqueue element: %d\n",i * 10);
        }
    }

    printf("\nqueue content: \n");
    TraverseQueue(&queue);

    printf("\ndelete queue: \n");
    ClearQueue(&queue);

    printf("\nqueue content: \n");
    TraverseQueue(&queue);

    return ;
}

/*void TestQueue2() {

}*/

int main()
{
    TestQueue1();

    //TestQueue2();

    return 0;
}
